package com.yanqu.road.entity.activity.recallplayer.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_u_recall_player_self_data")
public class UserRecallSelfData extends DataObject {
    @FieldTypeAnnotation(select = true, update = true, desc = "用户id")
    private long userId;
    @FieldTypeAnnotation(desc = "邀请码")
    private String recallCode;
    @FieldTypeAnnotation(desc = "是否分享过")
    private boolean hasFirstShared;
    @FieldTypeAnnotation(desc = "剩余抽奖次数")
    private int remainingLotteryTimes;
    @FieldTypeAnnotation(desc = "本层抽奖次数")
    private int hasDrawTimeThisFloor;
    @FieldTypeAnnotation(desc = "抽奖层数")
    private int floor;
    @FieldTypeAnnotation(desc = "抽奖单层数据")
    private List<RecallPlayerFloorCellData> cellDataList = new ArrayList<>();
    @FieldTypeAnnotation(desc = "总抽奖次数")
    private int totalDrawTime;


    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public String getRecallCode() {
        return recallCode;
    }

    public void setRecallCode(String recallCode) {
        if (recallCode == null) {
            return;
        }
        if (this.recallCode == null || !this.recallCode.equals(recallCode)) {
            this.recallCode = recallCode;
            setOp(DataStatus.Update);
        }
    }

    public boolean getHasFirstShared() {
        return hasFirstShared;
    }

    public void setHasFirstShared(boolean hasFirstShared) {
        if (this.hasFirstShared != hasFirstShared) {
            this.hasFirstShared = hasFirstShared;
            setOp(DataStatus.Update);
        }
    }

    public int getRemainingLotteryTimes() {
        return remainingLotteryTimes;
    }

    public void setRemainingLotteryTimes(int remainingLotteryTimes) {
        if (this.remainingLotteryTimes != remainingLotteryTimes) {
            this.remainingLotteryTimes = remainingLotteryTimes;
            setOp(DataStatus.Update);
        }
    }

    public boolean isHasFirstShared() {
        return hasFirstShared;
    }

    public int getHasDrawTimeThisFloor() {
        return hasDrawTimeThisFloor;
    }

    public void setHasDrawTimeThisFloor(int hasDrawTimeThisFloor) {
        if (this.hasDrawTimeThisFloor != hasDrawTimeThisFloor) {
            this.hasDrawTimeThisFloor = hasDrawTimeThisFloor;
            setOp(DataStatus.Update);
        }
    }

    public int getFloor() {
        return floor;
    }

    public void setFloor(int floor) {
        if (this.floor != floor) {
            this.floor = floor;
            setOp(DataStatus.Update);
        }
    }

    public List<RecallPlayerFloorCellData> getCellDataList() {
        return cellDataList;
    }

    public void setCellDataList(List<RecallPlayerFloorCellData> cellDataList) {
        if (null == cellDataList) {
            return;
        }
        if (this.cellDataList == null || !this.cellDataList.equals(cellDataList)) {
            this.cellDataList = cellDataList;
            setOp(DataStatus.Update);
        }
    }

    public int getTotalDrawTime() {
        return totalDrawTime;
    }

    public void setTotalDrawTime(int totalDrawTime) {
        if (this.totalDrawTime != totalDrawTime) {
            this.totalDrawTime = totalDrawTime;
            setOp(DataStatus.Update);
        }
    }
}
